float rmin;
float rmax;
float timer;

const float PI = 3.14f;

struct OutputVS {
    float4 posH   : POSITION0;
	float2 tex0   : TEXCOORD0;
};


OutputVS RingVS(float4 posL : POSITION0, float2 tex0: TEXCOORD0) {
    // Zero out our output.
	OutputVS outVS = (OutputVS)0;	
	// we are already in screen space
	outVS.posH = posL;
	outVS.tex0 = tex0; 
    return outVS;
}

float4 RingPS(float4 posL : POSITION0,float2 texCoord : TEXCOORD0) : COLOR {    
	texCoord = texCoord - 0.5;
	float r = sqrt(dot(texCoord,texCoord));
	if ( r < rmax && r > rmin) {
		float delta = ( r - rmin) / (rmax - rmin);
		float a = 0.6 * sin(r* PI);//clamp(0.5 * sin(delta * 3.14)+ 0.5 * cos(delta*0.31),0.0,1.0);
		return float4(0.4,0.0,0.0,a);
	}		
    return float4(0.2,0.0,0.2,0.0);
}

technique RingTech {

    pass P0 {
        vertexShader = compile vs_2_0 RingVS();
        pixelShader  = compile ps_2_0 RingPS();
    }
}
